/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: Teacher.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/27 下午8:37
 * LastModified: 2020/03/27 20:37:27
 */

package com.qolome.knowledge.design.pattern.observer.demo.gper;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Observable;
import java.util.Observer;

/**
 * @author Qolome
 * @version V1.0
 * @Description 老师订阅者
 * @date 2020年 03月27日 20:37:22
 */
@Data
@AllArgsConstructor
@Slf4j
public class Teacher implements Observer {

    private String techerName;


    @Override
    public void update(Observable o, Object arg) {
        Gper gper = (Gper) o;
        Question question = (Question) arg;
        log.info("================{}平台:{}老师收到提问拉  ===============",gper.getName(),techerName);
        log.info("你有一个来自{}同学的问题,请及时处理内容如下:↓\n{}",question.getStudentName(),question.getContent());

    }
}
